package com.kobi.tapeRecorder;

import java.io.IOException;
import java.io.InputStream;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TextView;

public class TermsActivity extends Activity {

	public TextView mTextView;
	private static Resources res;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.terms_layout);
		
		mTextView = (TextView) findViewById(R.id.txtTerms2);
		
		res = getResources();
		
		try
        {
			mTextView.setText(getDataFromRawFiles(R.raw.terms));
        }
        catch(IOException e)
        {
        	
        }
	}
	
	public static String getDataFromRawFiles(int id) throws IOException 
    {
    	InputStream in_s = res.openRawResource(id);

        byte[] b = new byte[in_s.available()];
        in_s.read(b);
    	String value = new String(b);
    	
    	return value;
    }
	
}
